<template>
  <el-form-item :label-width="item.labelWidth?item.labelWidth:'130px'" :label="item.title" :prop="rules?item.field:''">
    <span slot="label">{{item.title}}
      <el-tooltip v-if="item.info" :content="item.info" placement="top">
        <span class="fas fa-info-circle color"></span>
      </el-tooltip>
    </span>
    <el-radio-group @change="change" v-model="form[item.field]" :disabled="disabled">
      <el-radio  :label="i.value" v-for="i in item.optional" :key="i.value">{{i.name}}</el-radio>
    </el-radio-group>
  </el-form-item>

</template>

<script>
export default {
  // name: 'text'
  props: ['item', 'form', 'rules', 'disabled'],
  methods: {
    change(v) {
      if (this.item.itemChange) {
        this.item.itemChange(this.form, this.item, v);
      }
    }
  }
};
</script>

<style>

</style>
